package com.ciwong.epaper.modules.me.ui;

import android.view.View;

import com.ciwong.epaper.R;
import com.ciwong.epaper.modules.cordva.BaseHtmlActicity;
import com.ciwong.epaper.modules.me.util.MeJumpManager;
import com.ciwong.epaper.util.EConstants;
import com.ciwong.epaper.util.IntentFlag;
import com.ciwong.epaper.widget.NewLoginDialog;
import com.ciwong.mobilelib.i.ViewOnClickListener;

import org.apache.cordova.engine.SystemWebView;

/**
 * Created by keepon on 2017/10/11.
 */

public class FAQActivity extends BaseHtmlActicity {
    @Override
    public void loadData() {
        super.loadData();
        webView.setOnKeyBack(new SystemWebView.OnKeyBack() {
            @Override
            public boolean keyBack() {
                finish();
                return true;
            }
        });
        String title = getIntent().getStringExtra(IntentFlag.INTENT_FLAG_TITLE);
        String url = getIntent().getStringExtra(IntentFlag.INTENT_FLAG_URL);
//        setTitleText(title);
        setStartURL(url);
        loadUrl(url);
        setRightBtnText("意见反馈", R.color.color_light_green);
        setRightBtnListener(new ViewOnClickListener() {
            @Override
            public void avertRepeatOnClick(View v) {
                if (EConstants.IS_YOUKE) {
                    NewLoginDialog newLoginDialog = new NewLoginDialog(FAQActivity.this);
                    newLoginDialog.showLoginDialog();
                } else {
                    //跳到意见反馈
                    MeJumpManager.jumpToIssueRespActivity(R.string.go_back, FAQActivity.this);
                }

            }
        });
    }
}
